<%@page import="com.ingenio.dao.MarcaAdapter"%>
<%@page import="com.ingenio.business.Marca"%>
<%@page import="com.ingenio.dao.SubRubroAdapter"%>
<%@page import="com.ingenio.business.SubRubro"%>
<%@page import="com.ingenio.business.Rubro"%>
<%@page import="com.ingenio.dao.RubroAdapter"%>
<%@page import="com.ingenio.business.Categoria"%>
<%@page import="org.eclipse.jdt.core.compiler.CategorizedProblem"%>
<%@page import="com.ingenio.dao.CategoriaAdapter"%>
<%@page import="com.ingenio.business.Producto"%>
<%@page import="com.ingenio.dao.ProductoAdapter"%>
<%@page import="com.ingenio.business.Provincia"%>
<%@page import="com.ingenio.dao.ProvinciaAdapter"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Alta Proveedores</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">

   <!--link rel="stylesheet/less" href="less/bootstrap.less" type="text/css" /-->
   <!--link rel="stylesheet/less" href="less/responsive.less" type="text/css" /-->
   <!--script src="js/less-1.3.3.min.js"></script-->
   <!--append ‘#!watch’ to the browser URL, then refresh the page. -->
	
   <link href="../css/bootstrap.min.css" rel="stylesheet">
   <link href="../css/pedido.css" rel="stylesheet">
   <link href="../css/principal.css" rel="stylesheet">

  <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
  <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
  <![endif]-->

  <!-- Fav and touch icons -->
  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/apple-touch-icon-144-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/apple-touch-icon-114-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/apple-touch-icon-72-precomposed.png">
  <link rel="apple-touch-icon-precomposed" href="img/apple-touch-icon-57-precomposed.png">
  <link rel="shortcut icon" href="img/favicon.png">
  
  <script type="text/javascript" src="../js/jquery.min.js"></script>
  <script type="text/javascript" src="../js/bootstrap.min.js"></script>
  <script type="text/javascript" src="../js/ABMProveedores.js"></script>
  <script type="text/javascript" src="../js/notify.min.js"></script>
 </head>

<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
          </button>
          <a class="navbar-brand" href="index.jsp">InGenio</a>
        </div>
      </div>
    </nav>
<div class="container container--menu">
   <div class="row clearfix">
		<div class="col-md-12 column">
			<div class="page-header">
				<h1>Alta de Proveedores</h1>
			</div>
			<div class="clear"></div>
            <form action="../ABMProveedor" method="post" class="form-horizontal" role="form">
  			  <div class="form-group">
    			<label for="id_provincia" class="col-lg-2 control-label">ID Proveedor</label>
    			<div class="col-lg-2">
      			  <input type="text" class="form-control" id="id_proveedor" disabled>
    			</div>
  			  </div>
 			  <div class="form-group">
    			<label for="descripcion_proveedor" class="col-lg-2 control-label">Descripci&oacute;n</label>
    			<div class="col-lg-5">
      			  <input type="text" class="form-control" id="descripcion_proveedor" name="descripcion_proveedor">
      			  <input type="hidden" class="form-control" name="type" value="add">
    		    </div>
  			  </div>
  			  <div class="form-group">
    			<label for="id_provin" class="col-lg-2 control-label">Provincia</label>
    			<div class="col-lg-3">
	    			<select class="form-control select select-primary select-block mbl" id="id_provin" name="id_provin">
	 							<option value="-1">Provincia</option>	  						
	 							<% 
	 								ProvinciaAdapter pa = new ProvinciaAdapter();
    								List<Provincia> provincias = pa.devolverProvincias();
	 								for(Provincia p: provincias){
	 							%>
	  								<option value="<%=p.getIdProvincia()%>"><%=p.getDescProvincia() %></option>
	   							<% 
	 								}
	   							%>
	 				</select>
	    		</div>
	    		<label for="id_localidad" class="col-lg-2 control-label">Localidad</label>
	    		<div class="col-lg-3">
	    			<select class="form-control select select-primary select-block mbl" id="id_localidad" name="id_localidad">
	 					<option value="-1">Localidad</option>
	 				</select>
	    		</div>
  			  </div>
  			  <div class="form-group">
    			<label for="calle" class="col-lg-2 control-label">Calle</label>
    			<div class="col-lg-3">
      			  <input type="text" class="form-control" id="calle" name="calle">
    		    </div>
    		    <label for="nroExt" class="col-lg-1 control-label">Nro. Ext</label>
    			<div class="col-lg-2">
      			  <input type="text" class="form-control" id="nroExt" name="nroExt">
    		    </div>
    		    <label for="nroInt" class="col-lg-1 control-label">Nro. Int</label>
    		    <div class="col-lg-2">
      			  <input type="text" class="form-control" id="nroInt" name="nroInt">
    		    </div>
  			  </div>
  			  <div class="form-group">
    			<label for="telefono" class="col-lg-2 control-label">Telefono</label>
    			<div class="col-lg-4">
      			  <input type="text" class="form-control" id="telefono" name="telefono">
    		    </div>
    		    <label for="fax" class="col-lg-1 control-label">Fax</label>
    			<div class="col-lg-4">
      			  <input type="text" class="form-control" id="fax" name="fax">
    		    </div>
  			  </div>
  			  <div class="form-group">
    			<label for="email" class="col-lg-2 control-label">Email</label>
    			<div class="col-lg-5">
      			  <input type="text" class="form-control" id="email" name="email">
    		    </div>
  			  </div>
  			  <div class="form-group">
  			  	<label class="col-lg-1 control-label"></label>
  			  	<div class="col-lg-10">
            		<table class="table table-striped table-fixedheader prodTable">
			    		<thead>
							<tr>
								<th width="25%">C&oacute;digo</th>
								<th width="60%">Descripci&oacute;n</th>
								<th width="15%"><button type="button" class="btn btn-primary search buscarProd" data-toggle="modal" data-target="#buscarProducto">Buscar Producto</button></th>
							</tr>
						</thead>
						<tbody style="height:150px">
            			   <tr>
            			   		<td width="26%"><input type="text" id="ProductoID" name="ProductoID" class="form-control" value=""></td>
	            				<td width="66%"></td>
					    		<td width="8%"><a href="#" class="btn btn-inverse"><i class="glyphicon glyphicon-remove prodprov none"></i></a></td>
	            			</tr>
				  		</tbody>
					</table>
				</div>
  			  </div>
  			  <div class="form-group">
    		   <div class="col-lg-offset-2 col-lg-10">
    		     <button type="submit" class="btn btn-primary m20right btnConfirmar">Confirmar</button>
      		     <a href="listado_proveedor.jsp" class="btn btn-primary">Cancelar</a>
      		   </div>
    		  </div>
    		  <!-- toda esta parte es para la ventana modal de busqueda de productos -->
					 <div class="modal fade" id="buscarProducto" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
					 	<div class="modal-dialog">
					 		<div class="modal-content">
					 			<div class="modal-header">
					 			 	<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					 			 	<h4>Busqueda de productos</h4>
					 			</div>
					 			<div class="modal-body">
					 				<div class="row">
						 				<div class="col-md-10">
							 				<div class="row firstSearchRow" >
								 				<div class="col-md-4">
									 				<select class="form-control searchCategoria">
													  <option value="Categoria">Categoria</option>
													  <% CategoriaAdapter ca = new CategoriaAdapter();
													  	 List<Categoria> categorias = ca.devolverTodos();
													  	 for(Categoria c: categorias){
													  %>
													  		<option value="<%=c.getIdCategoria()%>"><%=c.getDescCategoria()%></option>		 
													  <%	 
													     }
													  %>
													  
													</select>
												</div>
												<div class="col-md-4">
									 				<select class="form-control searchRubro">
													  <option value="Rubro">Rubro</option>
													  <% RubroAdapter ra = new RubroAdapter();
													  	 List<Rubro> rubros = ra.devolverTodos();
													  	 for(Rubro r: rubros){
													  %>
													  		<option value="<%=r.getIdRubro()%>"><%=r.getDescRubro()%></option>		 
													  <%	 
													     }
													  %>
													</select>
												</div>
												<div class="col-md-4">
									 				<select class="form-control searchSubRubro">
													  <option value="SubRubro">Sub-Rubro</option>
													  <% SubRubroAdapter sra = new SubRubroAdapter();
													  	 List<SubRubro> subrubros = sra.devolverTodos();
													  	 for(SubRubro sr: subrubros){
													  %>
													  		<option value="<%=sr.getIdSubRubro()%>"><%=sr.getDecSubRubro()%></option>		 
													  <%	 
													     }
													  %>
													</select>
												</div>									
							 				</div>
							 				<div class="row modalrow2" >
								 				<div class="col-md-8">
									 				<input type="text" class="form-control searchDesc">
												</div>
												<div class="col-md-4">
									 				<select class="form-control searchMarca">
													  <option value="Marca">Marca</option>
													  <% MarcaAdapter ma = new MarcaAdapter();
													  	 List<Marca> marcas = ma.devolverTodos();
													  	 for(Marca m: marcas){
													  %>
													  		<option value="<%=m.getIDMarca()%>"><%=m.getDescMarca()%></option>		 
													  <%	 
													     }
													  %>
													</select>
												</div>									
							 				</div>
						 				</div>
						 				<div class="col-md-2 searchButton">
						 				  <a href="#" class="btn btn-primary btn-lg"><i class="icon-white glyphicon glyphicon-search"></i></a>
						 				</div>
					 				</div>
					 				<div class="row modalrow2">
					 					<table class="table table-striped table-fixedheader tableSecond">
										    <thead>
												<tr>
													<th width="5%">&nbsp;</th>
													<th width="25%">Codigo</th>
													<th width="70%">Descripcion</th>
												</tr>
											</thead>
											<tbody style="height:150px">
											</tbody>
										</table>
					 				</div>
					 			</div>
					 			<div class="modal-footer">
					 			 <button type="button" class="btn btn-primary btnAddModal" data-dismiss="modal">Agregar</button>
					 			 <button type="button" class="btn btn-primary btnCloseModal" data-dismiss="modal">Salir</button>
					 			</div>
					 		</div>
					 	</div>
					 </div>
					 <!-- Fin de la ventana modal -->
			</form>
			<div class="clear"></div>
		</div>
	</div>
</div>
</body>
</html>